package com.mzy.javaapi.exception;

import org.testng.annotations.Test;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/22 16:31
 * @Version 1.0
 */
public class TestException {

    @Test
    public void exception() {

        try {

            testException();
        }catch (ServerHandleException e){
            System.out.println(e.getMessage()+"ServerHandle"+ e);
        }
        catch (SystemException e) {
            System.out.println(e.getMessage()+"exception");
            e.printStackTrace();
        }
    }


    public void testException(){
        try {
            int i=3/0;
        } catch (Exception e) {
            System.out.println(e.getMessage()+"ssss");
            throw new ServerHandleException("出现异常情况");
        }
    }
}
